<?php

class Form extends CI_Controller{
	
	public function index()
	{
		$this->load->helper(array('form','url'));
		$this->load->library('form_validation');
		
		$this->form_validation->set_rules('username','username','required');
		$this->form_validation->set_rules('password','password','required');
		$this->form_validation->set_rules('email','email','required');
		if($this->form_validation->run() == FALSE)
		{
			 $this->load->view('register');
		}else{
			$this->load->model('register',"", TRUE);
			$this->register->insert_entry();
			$this->load->view("formsuccessfully");
		}
	}
	
}
